/**
 * Caclulates the Euler Totient function (phi)
 * 
 * @author Jon Ludwig
 */
import Euclid.*;


public class EuclidExport implements EuclidExporter {

	public String[] getExports()
	{
		return new String[] { "phi" };
	}
	
	public VarType phi(VarType a)
	{
		if (a instanceof SymbVarType)
			return phi(((SymbVarType)a).val);
		else if (a instanceof IntVarType)
			return new IntVarType(EulerTotient.phi(((IntVarType)a).val),
					"\\varphi(" + a.formula + ")");
		else
			return null;
	}
}
